Skip to content

Conversation

mustafadakhel
Copy link

This PR introduces support for formatting day-of-month ordinal numbers (e.g., "1st", "2nd").
#559

Feature Addition: Day-of-Month Ordinal Formatting

  • Added dayOrdinal method to DateTimeFormatBuilder for formatting ordinal day numbers using the customizable DayOrdinalNames.
  • The DayOrdinalNames is used to define the list of ordinal day names, with validation ensuring exactly 31 elements, and a predefined ENGLISH instance.
  • Introduced OrdinalDayDirective.
  • Added test coverage for the new functionalities.

@mustafadakhel
Copy link
Author

I am still not 100% sure if aiming for the max possible number of days in a month (31) is a good approach, if anyone has a better solution, you're more than welcome to share

@mustafadakhel mustafadakhel reopened this Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant